<template>
    <div>
        home
        {{$store.state.category.category.level}}
        {{$store.state.user.profile.token}}
        <button @click="changeName">ANNIU</button>
        <button @click="sendFn">发送请求</button>
    </div>
</template>

<script>
    import { SET_CATEGORY_INFO } from '@/store/category/actionsType'
    import { SET_USER_INFO } from '@/store/user/actionsType'
    import request from '@/utils/request'
    import { useStore } from 'vuex'
    export default {
        name: 'Home',
        setup() {
            const store = useStore()

            const changeName = () => {
                store.dispatch(SET_CATEGORY_INFO, { level: 2 })
                store.dispatch(SET_USER_INFO, { token: 'pppppp' })
            }
            const sendFn = () =>{
                request('/api/member/profile','get',{a:10})
            }
            return {
                changeName,
                sendFn
            }
        }

    }
</script>

<style>

</style>